package com.kania.simpleemail;

import com.kania.simpleemail.maillist.MailListActivity;
import com.kania.simpleemail.setup.ProviderListActivity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class Welcome extends Activity {

	private SharedPreferences spAccountInfo;
	private final String STRING_ACCOUNT_PREFERENCE_NAME = "account_info";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		spAccountInfo = this.getSharedPreferences(STRING_ACCOUNT_PREFERENCE_NAME, Activity.MODE_PRIVATE);
		String sExistAccount = spAccountInfo.getString("exist_account", "");
		
		if ("".equalsIgnoreCase(sExistAccount)) {
			Intent intentProviderList = new Intent(Welcome.this, ProviderListActivity.class);
			startActivity(intentProviderList);
		}
		else {
			Intent intentMaillist = new Intent(Welcome.this, MailListActivity.class);
			startActivity(intentMaillist);
		}
		this.finish();
	}
}
